#include "my_application.h"

#include<dlfcn.h>
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
using namespace std;

typedef int (*OPO_Open)(const char* sConnect);

// OPO_Open load()
// {
//  OPO_Open f = dlopen("/home/opoadmin/workspace/flutterCallDll/flutter_application/assets/libscalessdk.so", RTLD_LAZY);
//  return f;

// }

int main(int argc, char** argv) {

//  void *f = dlopen("./libscalessdk.so", RTLD_LAZY);
  
//     //  OPO_Open f = (OPO_Open)dlopen("/home/opoadmin/workspace/flutterCallDll/flutter_application/build/linux/x64/debug/bundle/data/flutter_assets/assets/libscalessdk.so", RTLD_LAZY);
//   if(!f)
//   {
//       std::cout << "load error..................." << std::endl;
//   //     system("pause");
//   //     return -1;
//   }
  // int r = (*f)("ttyS0");
  // if(r == 1)
  // {
    // std::cout << "success..................." << std::endl;
  // }
  // else{
  //   std::cout << "failed..................." << std::endl;
  // }


  g_autoptr(MyApplication) app = my_application_new();
  return g_application_run(G_APPLICATION(app), argc, argv);
}
